<?php
	defined( '_JEXEC' ) or die( 'Restricted access' );
	jimport('joomla.application.component.view');
	jimport('joomla.file.path');
	
	class ActinMapViewHome extends JView
	{
		var $_option = null;
		
		function display($tpl = null)
		{
			$this->addCSS();
			$this->addJavascripts();
			parent::display($tpl);
		}
		private function addCSS(){
			$option=JRequest::getCmd('option');
			
			$document=&JFactory::getDocument();
			$document->addStyleSheet('components/'.$option.'/css/sunny/jquery-ui-1.8.11.custom.css');
			$document->addStyleSheet('components/'.$option.'/css/actinmap.css');
		}
		private function addJavascripts(){
			$option=JRequest::getCmd('option');
			
			$document=&JFactory::getDocument();
			$document->addScript('http://maps.google.com/maps/api/js?sensor=false');
			$document->addScript('components/'.$option.'/js/jquery-1.5.1.min.js');
			$document->addScript('components/'.$option.'/js/jquery-ui-1.8.11.custom.min.js');
			$id=JFactory::getUser()->id;
			$js=null;
			if($id==0){
				$js='var idUsuario=null;';
			}
			else{
				$js='var idUsuario='.$id.';';
			}
			$document->addScriptDeclaration($js);
			$document->addScript('components/'.$option.'/js/eventsMap.js');
			$document->addScript('components/'.$option.'/js/eventsHome.js');
			$document->addScript('components/'.$option.'/js/eventFiltering.js');
		}
		
		public function paintMapPanel(){
			include JPath::find($this->_path['template'],'mapPanel.php');
		}
		
		public function paintMultiPanel(){
			include JPath::find($this->_path['template'],'multiPanel.php');
		}
		
		public function paintFilterPanel(){
			include JPath::find($this->_path['template'],'filterSearchPanel.php');
		}
		
		public function paintCommentsPanel(){
			include JPath::find($this->_path['template'],'commentsPanel.php');
		}
		
		public function paintCommentFormPanel(){
			$this->assignRef('option',JRequest::getCmd('option'));
			include JPath::find($this->_path['template'],'commentFormPanel.php');
		}
		
		public function paintCommentPanel(){
			include JPath::find($this->_path['template'],'commentPanel.php');
		}
		
	}
?>